home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / SciAn / src / ScianWindows.h < prev   
C/C++ Source or Header  |  1994-08-01  |  7KB  |  208 lines

  1. /*ScianWindows.h
  2.   Routines for windows in scian
  3.   Eric Pepke
  4.   March 8, 1990
  5. */
  6.  
  7. #ifndef _H_WINDOWS
  8. #define _H_WINDOWS
  9.  
  10. /*Flags for a window*/
  11. #define WINRGB        1        /*Window wants to be RGB*/
  12. #define WINDBUF        2        /*Window wants to be double buffered*/
  13. #define WINZBUF        4        /*Window wants to be Z-buffered*/
  14. #define WINFIXEDLOC    8        /*Fixed location*/
  15. #define WINFIXEDSIZE    16        /*Fixed size window*/
  16. #ifdef NOHIDEFRAME
  17. #define WINNOFRAME    0        /*Must have window frame*/
  18. #else
  19. #define WINNOFRAME    32        /*No window frame*/
  20. #endif
  21. #define WINCENTERED    64        /*Center the window*/
  22. #define WINICONIFIED    128        /*Window is iconified*/
  23.  
  24. #if MACHINE == RS6000
  25. #define WINUI        (WINDBUF | WINRGB)
  26. #else
  27. #define WINUI        (WINDBUF)
  28. #endif
  29.  
  30. extern Bool hasRGB;            /*Has RGB mode*/
  31. extern Bool hasCmap;            /*Has color map mode*/
  32. extern Bool hasRGBDouble;        /*Has RGB double buffer*/
  33. extern Bool hasCmapDouble;        /*Has Cmap double buffer*/
  34. extern Bool hasZbuf;            /*Has Z-buffer*/
  35. extern Bool hasTransparency;        /*Has hardware transparency*/
  36. extern Bool hasTwoSided;        /*Has two-sided lighting model*/
  37. extern int nOverDrawPlanes;        /*Number of overdraw planes*/
  38. extern Bool pupForOverDraw;        /*PUP planes are used for over draw, else overlay*/
  39. extern Bool rgbGoodForUI;        /*RGB mode good for user interface*/
  40. extern int cmapBitPlanes;        /*# color map bit planes*/
  41. extern Bool scavengeColors;        /*Whether to scavenge for colors*/
  42. extern int rBitPlanes, gBitPlanes, bBitPlanes;
  43.                     /*r, g, b bit planes*/
  44. extern Bool showConfig;            /*True iff want to show configuration*/
  45. extern Bool hasDithering;        /*True iff system has dithering*/
  46. extern Bool hasAntialiasedLines;    /*True iff system has anti-aliased lines*/
  47. extern Bool hasAntialiasedPoints;    /*True iff system has anti-aliased points*/
  48. extern Bool hasDepthCue;        /*True iff system has depth cueing*/
  49. extern Bool hasStereo;            /*True iff has CrystalEyes stereo*/
  50.  
  51. /*Macro to determine if a window is double buffered currently*/
  52. #define AreFlagsDoubleBuf(flags)  ((((flags) & WINRGB) && hasRGB) ?    \
  53.     (hasRGBDouble && ((flags) & WINDBUF) ? true : false) :        \
  54.     (hasCmapDouble && ((flags) & WINDBUF) ? true : false))
  55. #define IsDoubleBuf(window) AreFlagsDoubleBuf(((WinInfoPtr) (window)) -> flags)
  56.  
  57. #define IsWindowOpened(w) (((w) && ((WinInfoPtr) (w)) -> id) ? true : false)
  58.  
  59. /*Values for drawingQuality*/
  60. #define DQ_MIN        -4        /*Minimum drawing quality*/
  61. #define DQ_OUTLINE    -3        /*Draw as outline*/
  62. #define DQ_WALLS    -2        /*Draw walls*/
  63. #define DQ_DOTS        -1        /*Draw as dots*/
  64. #define DQ_WIREFRAME    0               /*Draw as a wire frame*/
  65. #define DQ_FULL         1               /*Draw with full quality*/
  66. #define DQ_MAX        2        /*Maximum drawing quality*/
  67.  
  68. extern int drawingQuality;              /*Current drawing quality*/
  69. extern int movingDrawingQuality;        /*Current moving drawing quality*/
  70.  
  71. typedef struct win            /*Window information structure*/
  72.     {
  73.     Thing thing;            /*Thing part of the window*/
  74.     long id;            /*Window identifier*/
  75.     long flags;            /*Flags for the window*/
  76.     struct win *next;        /*Next window record in the list*/
  77.     int ol, or, ot, ob;        /*Old bounds*/
  78.     int nl, nr, nt, nb;        /*New bounds*/
  79.     char winTitle[256];        /*Title of the window*/
  80.     int minWidth, maxWidth;
  81.     int minHeight, maxHeight;
  82.     } WinInfo, *WinInfoPtr;
  83.  
  84. extern WinInfoPtr inputWindow;        /*Current window for input or 0*/
  85. extern WinInfoPtr selWinInfo;           /*Info for currently selected window*/
  86. #ifdef GRAPHICS
  87. #if 1
  88. #define SelWindow(w) selWinInfo = w; if (w && ((WinInfoPtr) w) -> id) {winset(((WinInfoPtr) w) -> id);\
  89.         curDisplayMode = getdisplaymode();\
  90.         rgbp = (curDisplayMode == DMSINGLE || curDisplayMode == DMDOUBLE) ? false : true;}
  91. #else
  92. void SelWindow(WinInfoPtr w);
  93. #endif
  94. #else
  95. #define SelWindow(w) selWinInfo = w;
  96. #endif
  97.  
  98. extern int curDisplayMode;        /*Display mode of current window*/
  99. extern Bool rgbp;            /*rgb predicate*/
  100. extern ObjPtr windowClass;        /*Class of all windows*/
  101. typedef int WindowID;            /*Machine-specific window identifier*/
  102. extern WinInfoPtr allWindows;        /*All the windows*/
  103. extern int updateBatch;            /*Current batch of updates*/
  104. extern short curCursor;            /*Current cursor*/
  105. extern Bool showControlPanels;        /*Show subsequent control panels*/
  106.  
  107. void DoClose();
  108.  
  109. #ifdef PROTO
  110. void ResetMovingQuality(void);
  111. WinInfoPtr NewWinInfo(ObjPtr, long, long, char *, int, int, int, int);
  112. WinInfoPtr GetWinInfo(long);
  113. WinInfoPtr GetWinFromTitle(char *);
  114. Bool DisposeAllWindows(void);
  115. Bool IdleAllWindows(void);
  116. void DrawWindow(long);
  117. void ArrowWindow(long, long);
  118. void DoToggleColorMode(void);
  119. void DoToggleShrinkMode(void);
  120. void DoMaxScreen(void);
  121. void DoVideoScreen(void);
  122. void Do2VideoScreen(void);
  123. void DoPhscoScreen(void);
  124. int ReshapeWindow(ObjPtr);
  125. void InitWindows(void);
  126. void KillWindows(void);
  127. WindowID NewOpenedWindow(char *, int, int, int, int, long);
  128. void SetWindowTitle(ObjPtr, char *);
  129. void MySetCursor(int);
  130. void SetMode(WinInfoPtr);
  131. void LocateWindow(int, int, int, int);
  132. void SetShrink(WinInfoPtr, Bool);
  133. void SetMinSize(WinInfoPtr, int, int);
  134. void PopWindow(WinInfoPtr);
  135. void PushWindow(WinInfoPtr);
  136. void SaveScreen(WinInfoPtr, int);
  137. void GetWindowBounds(int *, int *, int *, int *);
  138. void GetWindowOrigin(int *, int *);
  139. void SetWindowPosition(int, int, int, int);
  140. void ForAllWindows(void (*routine)());
  141. Bool IsValidWindow(WinInfoPtr);
  142. void PopDatasetsWindow(void);
  143. void PopRecorderDriversWindow(void);
  144. WinInfoPtr WhichWindow(int x, int y);
  145. WinInfoPtr TopWindow(void);
  146. WinInfoPtr BottomWindow(void);
  147. Bool BelowAllBut(WinInfoPtr, WinInfoPtr);
  148. Bool AboveAllMainWindows(WinInfoPtr);
  149. void GetConfiguration(void);
  150. void CloseWindow(WinInfoPtr);
  151. void CEWS(WinInfoPtr, int, int);
  152. Bool ObjectNameMatches(char *pattern, char *candidate);
  153. void CopyIntoClipboard(ObjPtr);
  154. void PasteError(ObjPtr, ObjPtr);
  155. void PopFileReadersWindow(void);
  156. void ToClipboard(ObjPtr);
  157. ObjPtr FromClipboard();
  158. #else
  159. void ResetDrawingQuality();
  160. WinInfoPtr NewWinInfo();
  161. WinInfoPtr GetWinInfo();
  162. WinInfoPtr GetWinFromTitle();
  163. Bool DisposeAllWindows();
  164. Bool IdleAllWindows();
  165. void DoToggleShrinkMode();
  166. void DrawWindow();
  167. void ArrowWindow();
  168. void DoMaxScreen();
  169. void DoVideoScreen();
  170. void Do2VideoScreen();
  171. void DoPhscoScreen();
  172. int ReshapeWindow();
  173. void InitWindows();
  174. void KillWindows();
  175. WindowID NewOpenedWindow();
  176. void SetWindowTitle();
  177. void MySetCursor();
  178. void SetMode();
  179. void LocateWindow();
  180. void SetShrink();
  181. void SetMinSize();
  182. void PopWindow();
  183. void PushWindow();
  184. void SaveScreen();
  185. void GetWindowBounds();
  186. void GetWindowOrigin();
  187. void SetWindowPosition();
  188. void ForAllWindows();
  189. Bool IsValidWindow();
  190. void PopDatasetsWindow();
  191. void PopRecorderDriversWindow();
  192. WinInfoPtr WhichWindow();
  193. WinInfoPtr TopWindow();
  194. WinInfoPtr BottomWindow();
  195. Bool BelowAllBut();
  196. Bool AboveAllMainWindows();
  197. void GetConfiguration();
  198. void CloseWindow();
  199. Bool ObjectNameMatches();
  200. void CopyIntoClipboard();
  201. void PasteError();
  202. void PopFileReadersWindow();
  203. void ToClipboard();
  204. ObjPtr FromClipboard();
  205. #endif
  206.  
  207. #endif
  208.